// 封装组织架构的请求
import request from '@/utils/request'

export function getDepartment() { // 请求部门列表信息
  return request({
    url: '/company/department'
  })
}

export function delDepartment(id) { // 删除部门列表信息
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 编辑部门
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 封装编辑部门接口
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
